<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/page/share/taglib.jsp" %>
<html>
<head>
<title>上传文件管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="/css/vip.css" type="text/css">
<script language="JavaScript">
<!--
	//到指定的分页页面
	function topage(page){
		var form = document.forms[0];
		form.page.value=page;
		form.submit();
	}
	
	function allselect(allobj,items){
	    var state = allobj.checked;
	    if(items.length){
	    	for(var i=0;i<items.length;i++){
	    		if(!items[i].disabled) items[i].checked=state;
	    	}
	    }else{
	    	if(!items.disabled) items.checked=state;
	    }
	}

	/*
	 * 判断是否选择了记录
	 */
	function validateIsSelect(allobj,items){
	    var state = allobj.checked;
	    if(items.length){
	    	for(var i=0;i<items.length;i++){
	    		if(items[i].checked) return true;
	    	}
	    }else{
	    	if(items.checked) return true;
	    }
	    return false;
	}
	
	function deleteFiles(objform){
		if(validateIsSelect(objform.all, objform.fileids)){
			if(!confirm("是否执行该操作"))return;
			objform.action='<s:url action="file_delete.html"/>';
			objform.submit();
		}else{
			alert("请选择要操作的记录");
		}
		
	}
//-->
</script>
<script language="JavaScript" src="/js/FoshanRen.js"></SCRIPT>
</head>

<body bgcolor="#FFFFFF" text="#000000" marginwidth="0" marginheight="0">
<s:form action="file_list.html" method="post">
<s:hidden name="page"/>
	<table width="98%" height="35" border="0" align="center"
  	style="margin-top: 6px;margin-bottom: 10px;">
  	<tr style="background-color: #9CDCF9;"><td class="STYLE1">
  		&nbsp;&nbsp;&nbsp;&nbsp;你现在的位置是： 上传文件管理&nbsp;&nbsp; &gt;&gt; &nbsp;文件列表</td>
  	</tr>
  	</table>
  <table width="98%" border="0" align="center">
    <tr>
      <td width="8%" bgcolor="#9CDCF9"> <div align="center"><font color="#1E5494">选择</font></div></td>
      <td width="10%" bgcolor="#9CDCF9"> <div align="center"><font color="#1E5494">代号</font></div></td>
      <td width="60%" bgcolor="#9CDCF9"> <div align="center"><font color="#1E5494">文件</font></div></td>
	  <td width="22%" nowrap="nowrap" bgcolor="#9CDCF9"> <div align="center"><font color="#1E5494">上传时间</font></div></td>
    </tr>
<!---------------------------LOOP START------------------------------>
<c:forEach items="${pageView.records}" var="entity">
    <tr>
      <td bgcolor="f5f5f5"> <div align="center"><INPUT TYPE="checkbox" NAME="fileids" value="${entity.id}"}></div></td>
      <td bgcolor="f5f5f5"> <div align="center">${entity.id}</div></td>
      <td bgcolor="f5f5f5"> <div align="center"><a href="${entity.filePath}" target="_blank">${entity.filePath}</a></div></td>
	  <td bgcolor="f5f5f5"> <div align="center">${entity.uploadTime}</div></td>
	</tr>
</c:forEach>
    <!----------------------LOOP END------------------------------->
    <tr>
      <td bgcolor="f5f5f5" colspan="4" align="center">
      <table width="100%" border="0" cellspacing="1" cellpadding="3">
          <tr> 
            <td width="10%"><INPUT TYPE="checkbox" NAME="all" <c:if test="${fn:length(pageView.records)<1}">disabled="disabled"</c:if>
             onclick="javascript:allselect(this, this.form.fileids)">全选</td>
              <td width="85%">
              <input type="button" class="frm_btn" <c:if test="${fn:length(pageView.records)<1}">disabled="disabled"</c:if>
              onClick="javascript:deleteFiles(this.form)" value=" 删 除 "> &nbsp;&nbsp;
            </td>
          </tr>
        </table></td>
    </tr>
    <tr >
    	<td colspan="4" align="right">
    	<%@ include file="/WEB-INF/page/share/fenye.jsp" %>
   		</td>
   	</tr>
  </table>
</s:form>
</body>
</html>